# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Eduardo Parra Mazuecos <eduparra90@gmail.com>

pkgname=python-odfpy
pkgver=1.4.2
pkgrel=4
pkgdesc='Python API and tools to manipulate OpenDocument files'
arch=('any')
url='https://github.com/eea/odfpy'
license=('Apache' 'GPL')
depends=('python-defusedxml')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-pytest')
source=("https://github.com/eea/odfpy/archive/release-$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('24ad087f38031b2fe60bf22811b9550887afe1cfdea80672d6573387c3025583')

build() {
  cd odfpy-release-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd odfpy-release-$pkgver
  PYTHONPATH=. pytest
}

package() {
  cd odfpy-release-$pkgver
  python -m installer --destdir="$pkgdir" dist/*whl
}
